package cn.iocoder.yudao.module.cdk.dal.mysql.cdkuser;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.cdk.controller.app.cdkuser.vo.CdkappuserPageReqVO;
import cn.iocoder.yudao.module.cdk.dal.dataobject.cdkuser.CdkuserDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * cdk使用用户 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CdkappuserMapper extends BaseMapperX<CdkuserDO> {

    default PageResult<CdkuserDO> selectPage(CdkappuserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CdkuserDO>()
                .eqIfPresent(CdkuserDO::getQq, reqVO.getQq())
                .eqIfPresent(CdkuserDO::getPhone, reqVO.getPhone())
                .betweenIfPresent(CdkuserDO::getLasttime, reqVO.getLasttime())
                .likeIfPresent(CdkuserDO::getName, reqVO.getName())
                .eqIfPresent(CdkuserDO::getEnable, reqVO.getEnable())
                .orderByDesc(CdkuserDO::getId));
    }

}